//
//  NSDictionary+Extend.m
//  XLDoctor
//
//  Created by longma on 2018/12/27.
//  Copyright © 2018年 XLH. All rights reserved.
//

#import "NSLayoutConstraint+MJUI.h"

@implementation NSLayoutConstraint (MJUI)

- (NSLayoutConstraint *)mj_setMultiplier:(CGFloat)multiplier {
        [NSLayoutConstraint deactivateConstraints:@[self]];
        NSLayoutConstraint *newConstraint = [NSLayoutConstraint constraintWithItem:self.firstItem
        attribute:self.firstAttribute
        relatedBy:self.relation
        toItem:self.secondItem
        attribute:self.secondAttribute
        multiplier:multiplier
        constant:self.constant];
        newConstraint.priority = self.priority;
        newConstraint.shouldBeArchived = self.shouldBeArchived;
        newConstraint.identifier = self.identifier;
        [NSLayoutConstraint activateConstraints:@[newConstraint]];
        return newConstraint;
}

@end
